package com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract;

import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.dto.BusinessEmployeeContractListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.param.BusinessEmployeeContractCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.param.BusinessEmployeeContractDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.param.BusinessEmployeeContractListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.param.BusinessEmployeeContractUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 员工合同信息
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Employee Contract Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessEmployeeContractCloudServiceFallback.class)
@RequestMapping("/business/employee/contract")
public interface BusinessEmployeeContractCloudService {

    // 查询员工合同信息列表
    @ApiOperation(value = "Query Employee Contract List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.BusinessEmployeeContractCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessEmployeeContractListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Employee Contract List", dataType = "BusinessEmployeeContractListCloudParam", dataTypeClass = BusinessEmployeeContractListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessEmployeeContractListCloudDto list(BusinessEmployeeContractListCloudParam param);

    // 创建员工合同信息
    @ApiOperation(value = "Create Employee Contract", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.BusinessEmployeeContractCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Employee Contract", dataType = "BusinessEmployeeContractCreateCloudParam", dataTypeClass = BusinessEmployeeContractCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessEmployeeContractCreateCloudParam param);


    // 编辑员工合同信息
    @ApiOperation(value = "Update Employee Contract", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.BusinessEmployeeContractCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Employee Contract", dataType = "BusinessEmployeeContractUpdateCloudParam", dataTypeClass = BusinessEmployeeContractUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessEmployeeContractUpdateCloudParam param);


    // 删除员工合同信息
    @ApiOperation(value = "Delete Employee Contract", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.contract.BusinessEmployeeContractCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Employee Contract", dataType = "BusinessEmployeeContractDeleteCloudParam", dataTypeClass = BusinessEmployeeContractDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessEmployeeContractDeleteCloudParam param);

}
